<?php
namespace app\api\validate\service;

use think\Validate;

class Customer extends Validate{

    protected $rule = [
        'id' => 'require',
        'shopname' => 'require',
        'mt_image' => 'require',
        'state' => 'require|between:1,2',
        'province' => 'require',
        'city' => 'require',
        'district' => 'require',
        'address' => 'require',
        'name' => 'require',
        'mobile' => 'require',
        'customer_type' => 'require',
        'yyzz_image' => 'require',
        'idcard_image' => 'require',
        'idcards_image' => 'require',
        'lat' => 'require',
        'lng' => 'require',
        'content' => 'require',
    ];

    protected $message = [
        'id.require' => 'id必传',
        'shopname.require' => '店铺名称必传',
        'mt_image.require' => '门头照必传',
        'state.require' => '客户类型必传',
        'province.require' => '省份必传',
        'city.require' => '城市必传',
        'district.require' => '区域必传',
        'address.require' => '地址必传',
        'name.require' => '法人姓名必传',
        'mobile.require' => '联系方式必传',
        'customer_type.require' => '客户主营项目必传',
        'yyzz_image.require' => '营业执照必传',
        'idcard_image.require' => '法人头像面必传',
        'idcards_image.require' => '法人国徽面必传',
        'lat.require' => '纬度必传',
        'lng.require' => '经度必传',
        'content.require' => '跟进内容必填',
    ];


    protected $scene = [
        'add' => ['shopname','mt_image','state','province','city','district','address','mt_image','name','customer_type','yyzz_image','idcard_image','idcards_image','lng','lat'],
        'edit' => ['id','shopname','mt_image','state','province','city','district','address','mt_image','name','customer_type','yyzz_image','idcard_image','idcards_image','lng','lat'],
        'follow' => ['id','content','lat','lng','address']
    ];
}